<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>采购退货单</title>
	<include file="Public:header" />
    <script language="javascript" type="text/javascript" src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>
	<style type="text/css">
		.input{width:130px; border:1px solid #ccc; padding:2px;}
		.input0{border:0px; padding:0px; margin:0px; height:14px; overflow:hidden;}
		.input2{border:1px solid #ccc; padding:0px; margin:1px 0px 1px 0px; height:20px; display:inline-block;}
		.select{width:180px; border:1px solid #ccc; height:25px; padding:2px;}
        <php>if(C("SHOW_LINE_AMOUNT")=="Y"){</php>
            .show_line_amount_flg{display:;}
        <php>}else{</php>
            .show_line_amount_flg{display:none;}
        <php>}</php>
	</style>
	<script type="text/javascript">		
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		function chkfrm(act)
		{
			
            if($('#acc_id').val()=='')
			{
				$.messager.show({title:'提示',msg:'请选择供应商',timeout:5000,showType:'slide'});
				return false;
			}
			if($('#curr_rate').val()=='')
			{
				$.messager.show({title:'提示',msg:'贷币不正确',timeout:5000,showType:'slide'});
				return false;
			}
			var v_item_num = $("#item_num").val();
			var v_item_ok = 0;
			for(var itemp=0;itemp<v_item_num;itemp++)
			{
				//alert($('#datarow'+itemp).length);
				if($('#datarow'+itemp).length<=0) continue;
				var stk_id=$("input[id='spitem["+itemp+"][stk_id]']").val();
				var stk_title=$("input[id='spitem["+itemp+"][stk_title]']").val();
				var stk_qty=$("input[id='spitem["+itemp+"][qty]']").val();
				var stk_price=$("input[id='spitem["+itemp+"][price]']").val();
				var stk_tax_rate=$("input[id='spitem["+itemp+"][tax_rate]']").val();
				var stk_disc_rate=$("input[id='spitem["+itemp+"][disc_rate]']").val();
				if(stk_id!="")
				{
					if(!isNaN(stk_qty) && stk_qty>0 && !isNaN(stk_price) && !isNaN(stk_tax_rate) && !isNaN(stk_disc_rate))
					{
						v_item_ok += 1;
					}else{
						$.messager.show({title:'提示',msg:'请检查【'+stk_title+'】的数量、或单价、税率、折扣是否正确',timeout:5000,showType:'slide'});
						return false;
					}
                    var stk_batch=$("select[id='spitem["+itemp+"][batch]']").val();
                    if(stk_batch!=null && stk_batch!="null" && stk_batch!="")
                    {
                        var arr_batch = stk_batch.split("⊕");
                        if(arr_batch.length>=5)
                        {
                            $("input[id='spitem["+itemp+"][batch_no]']").attr("value",arr_batch[0].split("=")[1]);
                            $("input[id='spitem["+itemp+"][expiry_date]']").attr("value",arr_batch[1].split("=")[1]);
                            $("input[id='spitem["+itemp+"][approval_no]']").attr("value",arr_batch[2].split("=")[1]);
                            $("input[id='spitem["+itemp+"][spec]']").attr("value",arr_batch[3].split("=")[1]);
                            $("input[id='spitem["+itemp+"][madein]']").attr("value",arr_batch[4].split("=")[1]);
                        }
                    }
				}
			}
			if(v_item_ok<=0)
			{
				$.messager.show({title:'提示',msg:'空单据',timeout:5000,showType:'slide'});
				return false;
			}
			var check_amount = $('#check_amount').val();
			if(check_amount=='' || isNaN(check_amount))
			{
				$.messager.show({title:'提示',msg:'错误的退款金额',timeout:5000,showType:'slide'});
				return false;
			}
			if(act=='post')
			{
				$('#form1').attr('action',"{:U('Purchasing/rns_post')}");
			}
			else if(act=='save-post')
			{
				$('#form1').attr('action',"{:U('Purchasing/rns_save_post')}");
			}
			$('#form1').submit();
		}
		
		function open_curr_window()
		{
			open_popup_currmas('objcode=curr_code&objrate=curr_rate&callback=parent.calc_total();');
		}
		function open_supplier_window()
		{
			open_popup_supplier('objid=acc_id&objtitle=acc_title');
		}
		function open_stkmas_window(itemno)
		{
			open_popup_stkmas('objid=spitem['+itemno+'][stk_id]&objtitle=spitem['+itemno+'][stk_title]&objuom=spitem['+itemno+'][stk_uom]&objpurprice=spitem['+itemno+'][price]&objdetail=1&callback=parent.get_batch('+itemno+');');
		}
        function get_batch(itemno)
		{
            var v_stk_id = $("input[id='spitem["+itemno+"][stk_id]']").val();
            var v_wh_id = $("input[id='spitem["+itemno+"][wh_id]']").val();
            if(v_stk_id.length<=0 || v_wh_id.length<=0)
			{
				return false;
			}
            $.post("{:U('Warehouse/get_batch')}",{stk_id:v_stk_id,wh_id:v_wh_id},function(data,status){
				var data = eval("(" + data + ")");				
				var message = data.msg;
				var stkinfo = data.data;
				if(message=='ok')
				{
                        //alert(stkinfo);return;
                        $("select[id='spitem["+itemno+"][batch]'] option").remove();
                        for(var i=0; i<stkinfo.length; i++)
                        {
                            var v_text = "批号="+stkinfo[i].batch_no+"⊕有效期="+stkinfo[i].expiry_date2+"⊕批准文号="+stkinfo[i].approval_no+"⊕规格="+stkinfo[i].spec+"⊕产地="+stkinfo[i].madein+"⊕库存="+stkinfo[i].open_qty+"";
                            $("select[id='spitem["+itemno+"][batch]']").append("<option value='"+v_text+"'>"+v_text+"</option>");
                        }
						return;
				}
				else
				{
					$("select[id='spitem["+itemno+"][batch]'] option").remove();
                    $.messager.show({title:'提示',msg:'错误：'+message,timeout:5000,showType:'slide'});
					return false;
				}
            });
        }
		function open_whmas_window(itemno)
		{
			open_popup_whmas('objid=spitem['+itemno+'][wh_id]&objtitle=spitem['+itemno+'][wh_title]&callback=parent.get_batch('+itemno+');');
		}
		function open_account_window(itemno)
		{
			open_popup_account('objid=manager&objtitle=manager_title');
		}
		function calc_total()
		{
			var v_item_num = $("#item_num").val();
			var v_amount1 = 0;
			var v_amount2 = 0;
			
			for(itemp=0;itemp<v_item_num;itemp++)
			{
				if($('#datarow'+itemp).length<=0) continue;
				var stk_id=$("input[id='spitem["+itemp+"][stk_id]']").val();
				var stk_qty=$("input[id='spitem["+itemp+"][qty]']").val();
				var stk_price=$("input[id='spitem["+itemp+"][price]']").val();
				var stk_tax_rate=$("input[id='spitem["+itemp+"][tax_rate]']").val();
				var stk_disc_rate=$("input[id='spitem["+itemp+"][disc_rate]']").val();
				var v_row_total = 0;
				if(stk_id=="")
				{
					stk_qty=0;
					$("input[id='spitem["+itemp+"][qty]']").attr('value','');
				}
				if(stk_id!="" && !isNaN(stk_qty) && stk_qty>0 && !isNaN(stk_price) && !isNaN(stk_tax_rate) && !isNaN(stk_disc_rate))
				{
					v_row_total = parseFloat(stk_qty)*parseFloat(stk_price)*parseFloat(stk_disc_rate)/100;
                    $("input[id='spitem["+itemp+"][line_amount]']").attr("value",v_row_total.toFixed(2));
					v_amount1 += v_row_total;
					v_amount2 += v_row_total + v_row_total*parseFloat(stk_tax_rate)/100;
				}
			}
			$("#amount1").attr("value",v_amount1.toFixed(2));
			$("#amount2").attr("value",v_amount2.toFixed(2));
		}
		function addRow(rownum)
		{
			var row_start = parseInt($("#item_num").val());
			var row_end = row_start + rownum;
			
			for(itemp=row_start;itemp<row_end;itemp++)
			{
				var list_html = '<div id="datarow'+itemp+'" class="list-body">';
				list_html += '<div class="list-t-l w150px">';
				list_html += '	<input type="text" id="spitem['+itemp+'][stk_id]" name="spitem['+itemp+'][stk_id]" style="display:none;" />';
				list_html += '	<span class="searchbox input2" >';
				list_html += '	<input id="spitem['+itemp+'][stk_title]" name="spitem['+itemp+'][stk_title]" readonly="true" type="text" class="input0" style="width:130px; " />';
				list_html += '	<span><span class="searchbox-button" onclick="open_stkmas_window('+itemp+')"></span></span></span>';
				list_html += '</div>';
				list_html += '<div class="list-t-l w100px">';
				list_html += '	<input type="text" id="spitem['+itemp+'][wh_id]" name="spitem['+itemp+'][wh_id]" value="{$whmas.id}" style="display:none;" />';
				list_html += '	<span class="searchbox input2" >';
				list_html += '	<input id="spitem['+itemp+'][wh_title]" name="spitem['+itemp+'][wh_title]" value="{$whmas.title}" readonly="true" type="text" class="input0" style="width:60px; " />';
				list_html += '	<span><span class="searchbox-button" onclick="open_whmas_window('+itemp+')"></span></span></span>';
				list_html += '</div>';
				list_html += '<div class="list-t-l w60px"><input type="text" id="spitem['+itemp+'][stk_uom]" name="spitem['+itemp+'][stk_uom]" class="input2" readonly="true" style="width:60px;" /></div>';
				
                list_html += '<div class="list-t-l w300px"><select id="spitem['+itemp+'][batch]" name="spitem['+itemp+'][batch]" class="input2" style="width:300px;" ><option value=""></option></select>';
                list_html += '    <input type="hidden" id="spitem['+itemp+'][batch_no]" name="spitem['+itemp+'][batch_no]" value="" />';
                list_html += '    <input type="hidden" id="spitem['+itemp+'][expiry_date]" name="spitem['+itemp+'][expiry_date]" value="" />';
                list_html += '    <input type="hidden" id="spitem['+itemp+'][approval_no]" name="spitem['+itemp+'][approval_no]" value="" />';
                list_html += '    <input type="hidden" id="spitem['+itemp+'][spec]" name="spitem['+itemp+'][spec]" value="" />';
                list_html += '    <input type="hidden" id="spitem['+itemp+'][madein]" name="spitem['+itemp+'][madein]" value="" />';
                list_html += '</div>';
                
                
                list_html += '<div class="list-t-l w60px"><input type="text" id="spitem['+itemp+'][qty]" name="spitem['+itemp+'][qty]" onchange="calc_total()" class="input2" style="width:60px;" /></div>';
				list_html += '<div class="list-t-l w60px"><input type="text" id="spitem['+itemp+'][price]" name="spitem['+itemp+'][price]" onchange="calc_total()" class="input2" style="width:60px;" /></div>';
				list_html += '<div class="list-t-l w60px"><input type="text" id="spitem['+itemp+'][tax_rate]" name="spitem['+itemp+'][tax_rate]" onchange="calc_total()" class="input2" value="0" style="width:60px;" /></div>';
				list_html += '<div class="list-t-l w60px"><input type="text" id="spitem['+itemp+'][disc_rate]" name="spitem['+itemp+'][disc_rate]" onchange="calc_total()" class="input2" value="100" style="width:60px;" /></div>';
				
                list_html += '<div class="list-t-l w60px show_line_amount_flg"><input type="text" id="spitem['+itemp+'][line_amount]" name="spitem['+itemp+'][line_amount]" readonly="true" class="input2" style="width:60px;" /></div>';
				
                list_html += '<div class="list-t-l w100px"><input type="text" id="spitem['+itemp+'][remark]" name="spitem['+itemp+'][remark]" class="input2" style="width:97px;"  /></div>';
				<if condition="$mydata['status_flg'] eq 'A'">
				list_html += '<div class="list-t-l w60px"><a href="javascript:;" onclick="datarow_remove('+itemp+')">删除行'+(itemp+1)+'</a></div>';
				</if>
				list_html += '</div>';
				$("#sp_list_body").append(list_html);
			}
			$("#item_num").attr("value",row_end);
		}
		function datarow_remove(itemno)
		{
			$.messager.confirm('询问', '确认要移除选中的行吗？', function(r){
				if (r){
						$('#datarow'+itemno).remove();
						calc_total();
					}
				});
		}
		function cancel_todo()
		{
			$.messager.confirm('询问', '确认要取消当前单据吗？', function(r){
					if (r){
						window.location.href="{:U('Purchasing/doc_status_to_c?id='.$mydata['id'].'')}";
					}
			});
		}
		window.onload=function()
		{
			
		}
	</script>
</head>
<body class="">

	<div class="demo-info space-out-10px">
		<div class="demo-tip icon-tip"></div>
		<div>采购退货单<if condition="$mydata['status_flg'] eq 'A'"> ：(1)点击放大镜可以选择所需的内容</if></div>
	</div>
	<form id="form1" method="post" action="{:U('Purchasing/rns_edit_save')}">
	<div class="space-out-10px">
		<div style="width:100%; height:25px;">
				<div class="list-t-l w60px">单据号码：</div>
				<div class="list-t-l w150px"><input type="text" id="mas_no" name="mas_no" class="input" value="{$mydata.mas_no}" readonly="true" /></div>
				
				<div class="list-t-l w60px" align="right">供应商：</div>
				<div class="list-t-l w200px">
					<input type="text" id="acc_id" name="acc_id" value="{$mydata.acc_id}" style="display:none;" />
					<span class="searchbox input2" >
					<input id="acc_title" name="acc_title" value="{$mydata.supplier_title}" readonly="true" type="text" class="input0" style="width:170px; " />
					<span><span class="searchbox-button" onclick="open_supplier_window()"></span></span></span>
				</div>
				
				<div class="list-t-l w60px" align="right">日期：</div>
				<div class="list-t-l w200px"><input type="text" id="fadate" name="fadate" class="easyui-datebox input"  editable="false" value="{$mydata.fadate|date='Y-m-d',###}" /></div>
		</div>
		<div style="height:3px; clear:both;"></div>
		<div style="width:100%; height:25px;">
				<div class="list-t-l w60px">单据状态：</div>
				<div class="list-t-l w150px"><input type="hidden" id="status_flg" name="status_flg" value="{$mydata.status_flg}" /><input type="text" name="tmp_title" class="input" value="{$mydata.status_flg|get_status_title=###}" readonly="true" /></div>
				
				<div class="list-t-l w60px" align="right">货币：</div>
				<div class="list-t-l w200px">
					<span class="searchbox input2" >					
					<input id="curr_code" name="curr_code" value="{$mydata.curr_code}" readonly="true" type="text" class="input0" style="width: 80px; ">
					<input id="curr_rate" name="curr_rate" value="{$mydata.curr_rate}" readonly="true" type="text" class="input0" style="width: 80px; ">
					<span><span class="searchbox-button" onclick="open_curr_window()"></span></span></span>					
				</div>
				
				<div class="list-t-l w60px" align="right">摘要：</div>
				<div class="list-t-l w200px"><input type="text" id="remark" name="remark" value="{$mydata.remark}" class="input" /></div>
		</div>
		
		
		<div class="list-box">
		<div class="list-title">
			<div class="list-t-l w150px">商品</div>
			<div class="list-t-l w100px">仓库</div>
			<div class="list-t-l w60px">单位</div>
            
            <div class="list-t-l w300px">批次</div>
            
			<div class="list-t-l w60px">数量</div>
			<div class="list-t-l w60px">单价</div>
			<div class="list-t-l w60px">税点%</div>
			<div class="list-t-l w60px">折扣%</div>
            
            <div class="list-t-l w60px show_line_amount_flg">金额</div>
            
			<div class="list-t-l w100px">备注</div>
		</div>
		<input type="hidden" id="item_num" name="item_num" value="{$item_num}" style="display:none;" />
		<div id="sp_list_body">
		<php>$v_amount1=0;$v_amount2=0;</php>
		<volist name="mydata_item" id="mydata_item" key="k">
		<div id="datarow{$k-1}" class="list-body">
			<div class="list-t-l w150px">
				<input type="text" id="spitem[{$k-1}][stk_id]" name="spitem[{$k-1}][stk_id]" value="{$mydata_item.stk_id}" style="display:none;" />
				<span class="searchbox input2" alt="{$mydata_item.stk_code} {$mydata_item.stk_title}" title="{$mydata_item.stk_code} {$mydata_item.stk_title}">
				<input id="spitem[{$k-1}][stk_title]" name="spitem[{$k-1}][stk_title]" value="{$mydata_item.stk_code} {$mydata_item.stk_title}" readonly="true" type="text" class="input0" style="width:130px; " />
				<span><span class="searchbox-button" onclick="open_stkmas_window({$k-1})"></span></span></span>
			</div>
			<div class="list-t-l w100px">
				<input type="text" id="spitem[{$k-1}][wh_id]" name="spitem[{$k-1}][wh_id]" value="{$mydata_item.wh_id}" style="display:none;" />
				<span class="searchbox input2" >
				<input id="spitem[{$k-1}][wh_title]" name="spitem[{$k-1}][wh_title]" value="{$mydata_item.wh_title}" readonly="true" type="text" class="input0" style="width:60px; " />
				<span><span class="searchbox-button" onclick="open_whmas_window({$k-1})"></span></span></span>
			</div>
			<div class="list-t-l w60px"><input type="text" id="spitem[{$k-1}][stk_uom]" name="spitem[{$k-1}][stk_uom]" value="{$mydata_item.stk_uom}" class="input2" readonly="true" style="width:60px;" /></div>
			
            <div class="list-t-l w300px">
                <select id="spitem[{$k-1}][batch]" name="spitem[{$k-1}][batch]" class="input2" style="width:300px;" >
                <option value="批号={$mydata_item.batch_no}⊕有效期={$mydata_item.expiry_date|get_date='Y-m-d',###}⊕批准文号={$mydata_item.approval_no}⊕规格={$mydata_item.spec}⊕产地={$mydata_item.madein}⊕">批号={$mydata_item.batch_no}⊕有效期={$mydata_item.expiry_date|get_date='Y-m-d',###}⊕批准文号={$mydata_item.approval_no}⊕规格={$mydata_item.spec}⊕产地={$mydata_item.madein}⊕</option>
                </select>
                <input type="hidden" id="spitem[{$k-1}][batch_no]" name="spitem[{$k-1}][batch_no]" value="" />
                <input type="hidden" id="spitem[{$k-1}][expiry_date]" name="spitem[{$k-1}][expiry_date]" value="" />
                <input type="hidden" id="spitem[{$k-1}][approval_no]" name="spitem[{$k-1}][approval_no]" value="" />
                <input type="hidden" id="spitem[{$k-1}][spec]" name="spitem[{$k-1}][spec]" value="" />
                <input type="hidden" id="spitem[{$k-1}][madein]" name="spitem[{$k-1}][madein]" value="" />
            </div>

            <div class="list-t-l w60px"><input type="text" id="spitem[{$k-1}][qty]" name="spitem[{$k-1}][qty]" value="{$mydata_item.qty|get_round=###,6}" onchange="calc_total()" class="input2" style="width:60px;" /></div>
			<div class="list-t-l w60px"><input type="text" id="spitem[{$k-1}][price]" name="spitem[{$k-1}][price]" value="{$mydata_item.price|get_round=###,6}" onchange="calc_total()" class="input2" style="width:60px;" /></div>
			<div class="list-t-l w60px"><input type="text" id="spitem[{$k-1}][tax_rate]" name="spitem[{$k-1}][tax_rate]" value="{$mydata_item.tax_rate|get_round=###,2}" onchange="calc_total()" class="input2" value="0" style="width:60px;" /></div>
			<div class="list-t-l w60px"><input type="text" id="spitem[{$k-1}][disc_rate]" name="spitem[{$k-1}][disc_rate]" value="{$mydata_item.disc_rate|get_round=###,2}" onchange="calc_total()" class="input2" value="100" style="width:60px;" /></div>
			
            <div class="list-t-l w60px show_line_amount_flg"><input type="text" id="spitem[{$k-1}][line_amount]" name="spitem[{$k-1}][line_amount]" value="{$mydata_item.amount1|get_round=###,2}" readonly="true" class="input2" style="width:60px;" /></div>
			 
            <div class="list-t-l w100px"><input type="text" id="spitem[{$k-1}][remark]" name="spitem[{$k-1}][remark]" value="{$mydata_item.remark}" class="input2" style="width:97px;"  /></div>
			<if condition="$mydata['status_flg'] eq 'A'">
			<div class="list-t-l w60px"><a href="javascript:;" onclick="datarow_remove({$k-1})">删除行{$k}</a></div>
			</if>
		</div>
		<php>$v_amount1+=(double)$mydata_item['amount1'];$v_amount2+=(double)$mydata_item['amount2'];</php>
		</volist>
		</div>
		
		</div>
		
		<div style="height:3px; clear:both;"></div>
		
		<div class="list-title">
			<div class="list-t-l w100px">
				<a href="javascript:void(0)" id="mb3" class="easyui-menubutton" menu="#menu_appendRow" iconCls="icon-add">增加行</a>
				<div id="menu_appendRow" style="width:150px;">
					<div onclick="addRow(1)">增加一行</div>
					<div class="menu-sep"></div>
					<div onclick="addRow(3)">增加三行</div>
					<div onclick="addRow(5)">增加五行</div>
					<div onclick="addRow(10)">增加十行</div>
				</div>
			</div>
			<div class="list-t-l w50px"></div>
			<div class="list-t-l w60px" style="text-align:center;">金额合计</div>
			<div class="list-t-l w100px"><input type="text" id="amount1" name="amount1" class="input2" value="<php>echo get_round($v_amount1);</php>" readonly="true" style="width:97px;"  /></div>
			<div class="list-t-l w60px" style="text-align:center;">价税合计</div>
			<div class="list-t-l w100px"><input type="text" id="amount2" name="amount2" class="input2" value="<php>echo get_round($v_amount2);</php>" readonly="true" style="width:97px;"  /></div>
			<div class="list-t-l w100px" style="text-align:center;">本次退款金额</div>
			<div class="list-t-l w150px"><input type="text" id="check_amount" name="check_amount" value="{$mydata.check_amount|get_round=###}" style="width:97px;border:1px solid #8F5700;padding:2px;background:#F4E4B4;"  /></div>
			
		</div>
		
		<div style="height:3px; clear:both;"></div>
		
	
		<div style="clear:both;">
				<div class="list-t-l w60px">制单：</div>
				<div class="list-t-l w160px"><input type="text" name="tmp_title" class="input" value="{$mydata.creater_username}" readonly="true" /></div>
				<div class="list-t-l w80px" align="right">过账：</div>
				<div class="list-t-l w160px"><input type="text" name="tmp_title" class="input" value="{$mydata.poster_username}" readonly="true" /></div>
				
				<div class="list-t-l w80px" align="right">采购：</div>
				<div class="list-t-l w160px">
					<span class="searchbox input2" >					
					<input id="manager" name="manager" value="{$mydata.manager}" readonly="true" type="text" class="input0" style="display:none; ">
					<input id="manager_title" name="manager_title" value="{$mydata.manager_title}" readonly="true" type="text" class="input0" style="width: 80px; ">
					<span><span class="searchbox-button" onclick="open_account_window()"></span></span></span>
				</div>
		</div>
		
		<div style="clear:both;">&nbsp;</div>
	
		<div style="clear:both;">
				<div class="list-t-l w60px">&nbsp;</div>
				<div>
					<input type="hidden" id="id" name="id" class="input" value="{$mydata.id}" />
					<input type="hidden" id="mas_code" name="mas_code" value="{$mydata.mas_code}" />
					<if condition="$mydata['status_flg'] eq 'A'">
					<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-save" onclick="chkfrm('save')">保存</a>
					<a href="javascript:void(0)" id="mb1" class="easyui-menubutton" menu="#menu_post_todo" iconCls="icon-ok" plain="false">过账</a>
					<div id="menu_post_todo" style="width:150px;">
						<div onclick="chkfrm('post')">过账</div>
						<div class="menu-sep"></div>
						<div onclick="chkfrm('save-post')">保存并过账</div>
					</div>
					<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancel_todo()">取消</a>
					</if>
					<if condition="$mydata['status_flg'] eq 'P'">
					<a href="javascript:void(0)" id="mb_track" class="easyui-menubutton" menu="#menu_track_todo" iconCls="icon-up" plain="false">追踪</a>
					<div id="menu_track_todo" style="width:150px;">
						<div onclick="javascript:parent.addTab('追踪总账凭证({$mydata.mas_code}#{$mydata.mas_no})','{:U('Finance/vou_track?refcode='.$mydata['mas_code'].'&refid='.$mydata['id'].'')}');">总账凭证</div>
						<div class="menu-sep"></div>
						<div onclick="javascript:parent.addTab('追踪成本凭证({$mydata.mas_code}#{$mydata.mas_no})','{:U('Warehouse/stk_track?refcode='.$mydata['mas_code'].'&refid='.$mydata['id'].'')}');">成本凭证</div>
					</div>
					</if>
					<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-print" style="display:;" onclick="window.open('{:U('Purchasing/rns_print?id='.$mydata['id'].'')}');">打印</a>
					<a href="{:U('Purchasing/rns_list')}" class="easyui-linkbutton" iconCls="icon-undo">返回</a>
				</div>
		</div>
	</div>
	</form>
	<include file="Public:window_popup" />
	
</body>
</html>
